import server from '../index.js'

function post(path, auth = true, config = true) {
  return server.api().post(path).auth(auth).config(config)
}

function get(path, auth = true, config = true) {
  return server.api().get(path).auth(auth).config(config)
}
export default {
  city: {
    list: post('/dt-base/base/city/list')
  },
  channel: {
    channelList: post('/dt-base/system/base/channel/pageAll'),
    channelInsert: post('/dt-base/system/base/channel/insert'),
    channelUpdate: post('/dt-base/system/base/channel/update'),
    channelDelete: get('/dt-base/system/base/channel/delete')
  },

  caseChannel: {
    caseChannelList: post('/dt-base/building/base/channel/pageAll'),
    // caseChannelList: post('/dt-base/building/base/channel/getWebDetailChannelList'),
    caseChannelInsert: post('/dt-base/building/base/channel/insert'),
    caseChannelUpdate: post('/dt-base/building/base/channel/update'),
    caseChannelDelete: get('/dt-base/building/base/channel/delete'),
    caseChannelTreeList: get('/dt-base/building/base/channel/getWebDetailChannelList'),
    channleList: get('/dt-base/building/base/channel/getAllChannel'),
    channleAnnexLogList: post('/dt-base/channel/annex/log/list'),

    // 线索渠道
    isShowRelationTip: post('/dt-base/building/base/channel/isShowRelationTip'), // 是否显示关联提示
    atOnceRelation: post('/dt-base/building/base/channel/atOnceRelation'), //立即关联
    unClueRelation: post('/dt-base/building/base/channel/unClueRelation'), // 取消关联
    clueRelation: post('/dt-base/building/base/channel/clueRelation'), // 新增关联
    clueChannelRelationList: post('/dt-base/building/base/channel/clueChannelList'), // 已关联线索渠道
    clueRelationList: post('/dt-base/building/base/channel/clueRelationList'), // 渠道集合

    mergeChannel: post('/dt-base/building/base/channel/mergeChannel'), // 渠道合并
    selectBaseChannelMergeList: post('/dt-base/building/base/channel/selectBaseChannelMergeList'),
    //获取案场开启且在合作日期内渠道列表
    getAppropriateByBuildingId: get(
      '/dt-base/building/clueChannel/building/clueChannel/getAppropriateByBuildingIdSys'
    )
  },

  downloadCenter: {
    downloadlList: post('/dt-base/order/annex/orAnnexParameterRecord/pageAll'),
    downloadlUpdateStatus: post('/dt-base/order/annex/orAnnexParameterRecord/update'),
    downloadlVerdict: post('/dt-base/order/annex/orAnnexParameterRecord/verdict')
  },

  article: {
    articleLabel: post('/dt-base/v1/LabelCategory/list2'), //文章标签
    oneExamine: post('/dt-base/v1/info/article/firstAudit/page'), //文章一级待审核列表
    oneAlreadyExamine: post('/dt-base/v1/info/article/firstAuditHistory/page'), //文章一级已审核列表
    firstExamine: post('/dt-base/v1/info/article/pass/rebut/first'), //文章一级审核
    twoExamine: post('/dt-base/v1/info/article/secondAudit/page'), //文章二级待审核列表
    twoAlreadyExamine: post('/dt-base/v1/info/article/secondAuditHistory/page'), //文章二级已审核列表
    secondExamine: post('/dt-base/v1/info/article/pass/rebut/second'), //文章二级级审核auditStatus  （1二级审核通过，2二级审核驳回）
    articleGet: post('/dt-base/v1/info/noToken/get'), // 文章信息-详情

    // 文章信息-新增
    articleCreate: post('/dt-base/v1/info/create'),
    articleUpdate: post('/dt-base/v1/info/update'), // 文章信息-修改
    articleList: post('/dt-base/v1/info/selectListByQueryCondition'), // 文章列表
    articleDelete: post('/dt-base/v1/info/delete'), // 文章删除
    articleReason: post('/dt-base/v1/info/article/rebut/reason'), // 查看驳回原因
    articleDetail: post('/dt-base/v1/info/getInfoForWeb'), // 文章信息-详情

    checkHasUnConfigArticle: get('/dt-base/v1/info/checkHasUnConfigArticle'), // 置业计划红点提示
    getConfigArticle: get('/dt-base/reportArticle/getConfigArticle'), // 置业计划红点提示

    updateConfigArticle: post('/dt-base/reportArticle/updateConfigArticle') // 置业计划修改
  },
  //消息管理
  message: {
    msgInsert: post('/dt-base/msg/insert'), //创建消息
    msgFindPages: post('/dt-base/msg/findPages'), //消息分页列表查询
    getMessageReadingDetails: post('/dt-base/msg/getMessageReadingDetails'), //消息阅读明细(公司下的全部案场)
    exportMessage: post('/dt-base/msg/exportMessage').tag('downloadCenter'), //消息阅读明细(导出Excel到下载中心)
    getMessageDetails: post('/dt-base/msg/getMessageDetails'), //消息详情
    updateMsg: post('/dt-base/msg/updateMsg'), //消息详情修改
    sendMsg: post('/dt-base/msg/sendMsg'), //发送消息

    notification: {
      list: post('/dt-base/msg/webPages'), // 消息中心
      readAll: post('/dt-base/msg/upAllReadMsg'),
      read: post('/dt-base/msg/upHaveReadMsg'),
      hasUnread: get('/dt-base/msg/checkForRedDotMsg'),
      tip: get('/dt-base/msg/upTopThreeMsg')
    }
  },
  //流程管理
  processManage: {
    processList: get('/dt-base/process/manage/list'), //流程管理列表
    processSave: post('/dt-base/process/manage/save'), //流程管理保存
    processUpdate: post('/dt-base/process/manage/update'), //流程管理修改
    detailList: post('/dt-base/process/detail/page'), //流程详情分页列表
    detailSave: post('/dt-base/process/detail/save'), //流程详情保存
    detailUpdate: post('/dt-base/process/detail/updateById'), //流程管理修改
    detailDelete: get('/dt-base/process/detail/deleteById') //流程详情删除
  },
  processAudit: {
    list: post('/dt-base/processAudit/page'),
    process: post('/dt-base/processAuditLog/list'),
    audit: post('/dt-base/processAudit/audit'),
    back: post('/dt-base/processAudit/cancle'),
    isAuditAuth: post('/dt-base/processAudit/isAuditAuth'), // 判断当前人审批权限
    transfer: post('/dt-base/processAudit/transmit') // 流程转交
  },
  // 通用配置
  generalConfiguration: {
    onlineCityList: post('/dt-base/base/city/online/page'), //上线城市列表
    onlineCityAdd: post('/dt-base/base/city/online/create'), //上线城市添加
    cityList: () => post('/dt-base/base/city/page'), //城市筛选条件
    onlineCityUpdate: post('/dt-base/base/city/online/update'), //上线城市修改
    areaPages: post('/dt-base/base/city/plate/page'), //区域列表
    areaUpdate: post('/dt-base/base/city/plate/update'), //区域更新
    areaDelete: post('/dt-base/base/city/plate/delete'), //区域删除
    areaAdd: post('/dt-base/base/city/plate/batchcreate'), //区域添

    loopAdd: post('/dt-base/base/loopline/batchcreate'), //环线增加
    loopPages: post('/dt-base/base/loopline/page'), //环线列表
    loopUpdate: post('/dt-base/base/loopline/update'), //环线修改
    loopDelete: post('/dt-base/base/loopline/delete'), //环线删除
    mettroAdd: post('/dt-base/base/metro/station/batchcreate'), //新增地铁信息
    mettroDelete: post('/dt-base/base/metro/station/delete'), //新增地铁信息
    mettroList: post('/dt-base/base/metro/station/list'), //新增地铁信息
    mettroUpdate: post('/dt-base/base/metro/edit'), //地铁信息编辑
    mettroUpdate: post('/dt-base/base/metro/edit'), //地铁信息编辑/dt-base/base/metro/list
    mettroHlist: post('/dt-base/base/metro/list') //地铁信息编辑
  },

  city: {
    cityBaseList: post('/dt-base/base/city/list') // 城市信息列表
  },

  info: {
    create: post('/dt-base/v1/info/create'),
    list: post('/dt-base/v1/info/list/audit/info'),
    audit: {
      first: post('/dt-base/v1/info/article/pass/rebut/first'),
      second: post('/dt-base/v1/info/article/pass/rebut/second'),
      log: get('/dt-base/v1/info/article/auditLog/list')
    }
  },
  // 线索渠道
  system: {
    clueChannelList: post('/dt-base/system/clueChannel/list'),
    startOrOff: post('/dt-base/system/clueChannel/startOrOff'),
    checkHasUnboundClue: post('/dt-base/building/base/channel/checkHasUnboundClue')
  },
  // 区域
  cityRegion: {
    regionList: post('/dt-base/base/city/areaList'),
    regionCreate: post('/dt-base/base/city/saveArea'),
    regionEidt: post('/dt-base/base/city/updateArea'),
    regionDel: post('/dt-base/base/city/delArea')
  },
  // 渠道
  selectBuildingChannelList: post('/dt-base/building/base/channel/selectBuildingChannelList'),
  //操作记录

  logPage: post('/dt-base/system/log/page'),
  logPageExport: post('/dt-base/system/log/export').tag('downloadCenter'),

  // 案场首页流程信息
  getStatisticsDetail: post('/dt-base/approvalStatistics/getStatisticsDetail'),
  SOP: {
    manageList: get('/dt-base/process/manage/list') //审批流
  },
  // 工作台
  work: {
    getOrgStatistics: post('/dt-base/web/approvalStatistics/getOrgStatistics'),
    otherList: post('/dt-base/web/approvalStatistics/otherList'),
    orgOtherList: post('/dt-base/web/approvalStatistics/orgOtherList')
  },
  // 案场复制
  buildingCopy: {
    buildingCopy: post('/dt-base/buildingCopy/copy').setTimeout(30000)
  }
}
